/**
 * Copyright (c) 2016-2019 优博信息科技 All rights reserved.
 *
 * https://www.jnyoubo.com
 *
 * 版权所有，侵权必究！
 */

package com.youbo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.youbo.entity.TokenEntity;

/**
 * 用户Token
 *
 * @author macy
 */
public interface TokenService extends IService<TokenEntity> {

	TokenEntity queryByToken(String token,Integer tokenType);

	TokenEntity queryByToken(Long userId,Integer tokenType);

	/**
	 * 生成token
	 * @param userId  用户ID
	 * @return        返回token信息
	 */
	TokenEntity createToken(long userId,Integer tokenType);

	/**
	 * 设置token过期
	 * @param tokenEntity
	 */
	void expireToken(TokenEntity tokenEntity);

}
